def Judge(score):
	if 90<=score<=100:
		return 'A'
	elif 80<=score<=89:
		return 'B'
	elif 70<=score<=79:
		return 'C'
	elif 60<=score<=69:
		return 'D'
	else:
		return 'F'

while True:
	score = raw_input()
	if score:
		print score, "is in grade ", Judge(int(score))
	else:
		break;

